<?php if (!defined('THINK_PATH')) exit();?><!DOCTYPE html>
<html lang="en">
<head>
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
    <meta charset="utf-8" />
    <title>OJ back-stage</title>
    <meta name="description" content="with selectable items(single &amp; multiple) and custom icons" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0" />
    <link rel="stylesheet" href="/assets/css/bootstrap.min.css" />
    <link rel="stylesheet" href="/assets/css/font-awesome.min.css" />
    <link rel="stylesheet" href="/assets/css/chosen.css" />
    <link rel="stylesheet" href="/assets/css/jquery-ui.custom.datepicer.min.css" />
    <link rel="stylesheet" href="/assets/css/ace.min.css" />
    <link rel="stylesheet" href="/assets/css/animate.min.css" />

    <script src="/js/date/WdatePicker.js"></script>

    <link rel="stylesheet" href="/assets/css/cig.css" />
    <!--[if lte IE 9]>
    <link rel="stylesheet" href="/assets/css/ace-part2.min.css" />
    <![endif]-->
    <!--<link rel="stylesheet" href="/assets/css/ace-skins.min.css" />
            <link rel="stylesheet" href="/assets/css/ace-rtl.min.css" />-->

    <!--[if lte IE 9]>
    <link rel="stylesheet" href="/assets/css/ace-ie.min.css" />
    <![endif]-->

    <script src="/assets/js/ace-extra.min.js"></script>

    <!--[if lte IE 8]>
    <script src="/js/html5shiv.js"></script>
    <script src="/assets/js/respond.min.js"></script>
    <![endif]-->
    <!--<script src="/js/jquery.min.js"></script>-->
    <!--<script src="/js/bootstrap.min.js"></script>-->

</head>

<body class="no-skin">
<div class="main-container" id="main-container">
    <script type="text/javascript">
        try{ace.settings.check('main-container' , 'fixed')}catch(e){}
    </script>
    <div id="sidebar" class="sidebar responsive">
        <script type="text/javascript">
            try{ace.settings.check('sidebar' , 'fixed')}catch(e){}
        </script>
        <div class="rq-logo">
            <a class="navbar-brand" href="<?php echo U('Index/index');?>">
                <span>OJ-Backstage</span>
            </a>
        </div>
        <ul class="nav nav-list">
            <?php if(is_array($menus)): foreach($menus as $m_k=>$m_val): ?><li <?php if($action == $m_k): ?>class="active"<?php endif; ?> >
                    <a href="<?php echo ($m_val['url']); ?>" <?php if(!empty($m_val["list"])): ?>class="dropdown-toggle"<?php endif; ?> >
                        <i class="menu-icon <?php echo ($m_val['label']); ?>"></i>
                        <span class="menu-text"><?php echo ($m_val["name"]); ?></span>
                        <?php if(!empty($m_val["list"])): ?><b class="arrow fa fa-angle-down"></b><?php endif; ?>
                    </a> <b class="arrow"></b>
                    <?php if(!empty($m_val["list"])): ?><ul class="submenu">
                            <?php if(is_array($m_val["list"])): foreach($m_val["list"] as $sub_k=>$sub_val): ?><li class="">
                                    <a href="<?php echo ($sub_val['url']); ?>">
                                        <i class="menu-icon fa fa-caret-right"></i><?php echo ($sub_val["name"]); ?></a>
                                    <b class="arrow"></b>
                                </li><?php endforeach; endif; ?>
                        </ul><?php endif; ?>
                </li><?php endforeach; endif; ?>
        </ul>
        <div class="sidebar-toggle sidebar-collapse" id="sidebar-collapse">
            <i class="ace-icon fa fa-angle-double-left" data-icon1="ace-icon fa fa-angle-double-left" data-icon2="ace-icon fa fa-angle-double-right"></i>
        </div>
    </div>
    <div class="main-content">

        <div class="breadcrumbs td-navbar" id="breadcrumbs">
            <script type="text/javascript">
                try{ace.settings.check('breadcrumbs' , 'fixed')}catch(e){}
            </script>
            <div class="btn-group pull-right">
                <button class="btn btn-default dropdown-toggle" data-toggle="dropdown">
                    <i class="fa fa-user"></i>
                    <span class="hidden-sm hidden-xs">hello <?php echo (($session["USER"]["nickname"])?($session["USER"]["nickname"]):$session['USER']['user_id']); ?></span>
                    <span class="caret"></span>
                </button>
                <ul class="dropdown-menu">
                    <li><a href="<?php echo U('User/loginOut');?>">退出</a></li>
                </ul>
            </div>

            <!-- /.breadcrumb -->
        </div>

<div class="page-content">
    <!-- content starts -->
    <div class="cig-page-header">
        <h1>新闻管理</h1>
    </div>
    <div class="row">
        <div class="box col-xs-12">
            <div class="box-inner">
                <div class="cig-box-header clearfix">
                    <div class="col-xs-6 ad-sel">
                        <form method="get" name="search" action="<?php echo U('News/index');?>">

                            <div class="col-xs-6 no-padding">
                                <input type="text" value="<?php echo ($condition); ?>"  name="condition" style="width: 100%">
                            </div>
                            <div class="col-xs-4">
                                <button type="submit" class="rq-btn btn-gray btn-heith-lg">查询</button>
                            </div>
                        </form>
                    </div>
                    <div class="col-xs-6 button-con">
                        <div class="cig-txt-right"> <a href="<?php echo U('News/add');?>" class="btn btn-success cig-btn-lg"><i class="fa fa-hand-o-right"></i>添加新闻</a> </div>
                    </div>
                </div>
                <div class="box-content">
                    <div class="row">
                        <div class="col-xs-12">
                        </div>
                        <div class="col-xs-12">
                            <table id="sample-table-2" class="table table-striped table-bordered table-hover dataTable" aria-describedby="sample-table-2_info">
                                <thead>
                                <tr role="row">
                                    <th>PID</th>
                                    <th>Title</th>
                                    <th>Date</th>
                                    <th>Status</th>
                                    <th>Operation</th>
                                </tr>
                                </thead>
                                <tbody>
                                <?php if(is_array($list)): foreach($list as $k=>$val): ?><tr>
                                        <td class=""><?php echo ($val["news_id"]); ?></td>
                                        <td><?php echo ($val["title"]); ?></td>
                                        <td class=""><?php echo ($val["time"]); ?></td>
                                        <td class="">
                                            <?php if($val['defunct'] == 'N'): ?>Available
                                                <?php else: ?>
                                                Reserved<?php endif; ?>

                                        </td>

                                        <td><span class="action-buttons"><a href="<?php echo U('/News/edit',array('id'=>$val[news_id]));?>" class="green" title="编辑"> <i class="ace-icon fa fa-pencil bigger-110"></i> </a><a id="" class="dark" href="<?php echo U('/News/delete',array('id'=>$val[news_id]));?>" title="删除"> <i class="ace-icon fa fa-trash-o bigger-120"></i> </a></span></td>

                                    </tr><?php endforeach; endif; ?>
                                <tr >
                                    <td colspan="5"><?php echo ($page->show()); ?></td>
                                </tr>
                                </tbody>
                            </table>
                        </div>

                    </div>
                </div>
            </div>
        </div>
    </div>

    <!--/row-->

</div>
<!--content-->
<div> </div>

</div>
<div class="footer">
    <div class="footer-inner">
        <!-- #section:basics/footer -->
        <div class="footer-content">
            <span class="bigger-120">
                <span class="blue bolder">&copy; </span>
                <p>Base on <a href='http://code.google.com/p/hustoj/'>HUSTOJ</a>
                    Copyright@<a href='http://comp.buct.edu.cn'>Computer Teaching and Experiment Center</a>
                    Administrator:lyong@mail.buct.edu.cn</p>
            </span>
        </div>
        <!-- /section:basics/footer -->
    </div>
</div>
<a href="#" id="btn-scroll-up" class="btn-scroll-up btn btn-sm btn-inverse"> <i class="ace-icon fa fa-angle-double-up icon-only bigger-110"></i> </a> </div>

<!--[if !IE]> -->
<script type="text/javascript">
    window.jQuery || document.write("<script src='/assets/js/jquery.min.js'>"+"<"+"/script>");
</script>

<!-- <![endif]-->

<!--[if IE]>
<script type="text/javascript">
    window.jQuery || document.write("<script src='/assets/js/jquery1x.min.js'>"+"<"+"/script>");
</script>
<![endif]-->
<script type="text/javascript">
    if('ontouchstart' in document.documentElement) document.write("<script src='/js/jquery.mobile.custom.min.js'>"+"<"+"/script>");
</script>
<script src="/assets/js/bootstrap.min.js"></script>

<!-- page specific plugin scripts -->

<!-- ace scripts -->
<script src="/assets/js/ace-elements.min.js"></script>
<script src="/assets/js/jquery-ui.custom.datepicer.min.js"></script>
<script src="/assets/js/ace.min.js"></script>

<!-- inline scripts related to this page -->
<script src="/assets/js/chosen.jquery.min.js"></script>
<script src="/assets/js/base.js"></script>
<script src="/assets/js/echarts-all.js"></script>

</body>
</html>